package com.example.dogliving.fragment.home;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by 张昭 on 2016/12/22.
 */

public class HomeViewPagerAdapter extends FragmentPagerAdapter {
    //申明list集合
    private List<Fragment> mList=null;
    //申明顶部导航数组
    private String []mArrTabTitle=null;
    public HomeViewPagerAdapter(List<Fragment> mList, FragmentManager fm, String[] mArrTabTitle) {
        super(fm);
        this.mList=mList;
        this.mArrTabTitle=mArrTabTitle;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return mArrTabTitle[position];
    }
}
